package com.kim.useroauth.server.controller;

import com.kim.common.utilcom.model.Result;
import com.kim.useroauth.server.client.OauthClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * UserAccountController
 */
@Api(tags = {"app: 用户账户相关", "检查是否授权"})
@Slf4j
@RestController
@RequestMapping("/app/v1/user")
public class UserAccountController {

    /**
     * tokenStore
     */
    @Resource
    private OauthClient oauthClient;

    /**
     * 用户登出
     * 登出移除access_token和refresh_token
     */
    @ApiOperation(value = "用户登出")
    @PostMapping(value = "/logout")
    public Result removeToken() {
        return oauthClient.removeToken();
    }
}
